package com.demo.controller;


import com.demo.dto.ProvinceDTO;
import com.demo.dto.Result;
import com.demo.entity.Province;
import com.demo.service.ProvinceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Zeng
 * @since 2022-03-23
 */
@Api(tags = "省份城市")
@RestController
@RequestMapping("/province")
public class ProvinceController {
    @Resource
    ProvinceService provinceService;

    @ApiOperation("获取所有省份及其城市")
    @GetMapping("/common/all_province_and_city")
    Result<List<ProvinceDTO>> allProvinceAndCity() {
        return Result.ok(provinceService.getProvinceDTOs());
    }
}

